package cn.seqdata.cxf.interceptor;

import org.apache.cxf.Bus;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.interceptor.InterceptorProvider;

public class WrappedFeature extends AbstractFeature {
	private final WrappedOutInterceptor out = new WrappedOutInterceptor();
	private final WrappedFaultOutInterceptor faultOut = new WrappedFaultOutInterceptor();

	@Override
	protected void initializeProvider(InterceptorProvider provider, Bus bus) {
		// 正常输出拦截
		provider.getOutInterceptors()
			.add(out);
		// 异常输出拦截
		provider.getOutFaultInterceptors()
			.add(faultOut);
	}
}
